package com.jh.paymentchannel.qctpos.eumn;

import org.apache.commons.lang.StringUtils;

public enum  QctposPayStatus {
    NOTPAY("NOTPAY", "付款中"),
    PAYSUCCESS("PAYSUCCESS", "支付成功"),
    AUTH_ERROR("PAYFAIL", "支付失败"),
    BUSINESS_ERROR("PAYCANCEL", "已撤销"),
    SIGN_ERROR("PAYTIMEOUT", "支付超时");

    QctposPayStatus(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;


    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDesc(String value) {
        if (StringUtils.isBlank(value)) return "";
        QctposPayStatus[] qctposBaseEnums = QctposPayStatus.values();
        for (QctposPayStatus qctposBaseEnum : qctposBaseEnums) {
            if (qctposBaseEnum.getValue().equals(value)) {
                return qctposBaseEnum.getDesc();
            }
        }
        return "";
    }
}
